Những câu hỏi liên quan
Pham Huynh Bao Thy
Xem chi tiết
nuinuini
Xem chi tiết
trần thu lan
Xem chi tiết
Nguyễn Thị Tươi
Xem chi tiết
Thùy Trinh Ngô
Xem chi tiết
NGUYỄN LÊ XUÂN THỊNH
Xem chi tiết
Nguyễn Lê Phước Thịnh
20 tháng 2 2023 lúc 0:38

Câu 6:

uses crt;

var n,i:integer;

begin

clrscr;

readln(n);

for i:=1 to n do 

if n mod i=0 then write(i:4);

readln;

end.

5:

uses crt;

var n,i,dem:integer;

begin

clrscr;

readln(n);

dem:=0;

for i:=0 to n do

if i mod 2=1 then 

begin

write(i:4);

dem:=dem+1;

end;

writeln;

writeln(dem);

readln;

end.

Bình luận (0)
Lê Thị Thùy Dung
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 2 2022 lúc 0:09

Bài 1: 

#include <bits/stdc++.h>

using namespace std;

long long i,n,x,t;

int main()

{

cin>>n;

t=0;

for (i=1; i<=n; i++)

{

cin>>x;

if (x%15==0) t=t+x;

}

cout<<t;

return 0;

}

Bình luận (0)
Phan Thị Ka
Xem chi tiết
Minh Lệ
19 tháng 3 2023 lúc 22:40

Câu 1:

Program HOC24;

var i,p: integer;

t: longint;

begin

write('Nhap P: '); readln(p);

t:=0;

for i:=1 to p do if i mod 2<>0 then t:=t+i;

write('Tong cac so le la: ',t);

readln

end.

Bình luận (0)
Minh Lệ
19 tháng 3 2023 lúc 22:41

Câu 2:

Program HOC24;

var i,n: integer;

t: longint;

begin

write('Nhap N: '); readln(n);

t:=0;

for i:=1 to n do if i mod 2=0 then t:=t+i;

write('Tong cac so chan la: ',t);

readln

end.

Bình luận (0)
Minh Lệ
19 tháng 3 2023 lúc 22:42

Câu 3:

Program HOC24;

var i,t,n: integer;

begin

write('Nhap N: '); readln(n);

t:=0;

for i:=1 to n do if n mod i=0 then t:=t+i;

write('Tong cac uoc cua ',n,' la: ',t);

readln

end.

Bình luận (0)
Lê Đăng Khôi
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 2 2023 lúc 15:39

1:

uses crt;

var t,x,i,n:integer;

begin

clrscr;

t:=0;

n:=10;

for i:=1 to n do

begin

readln(x);

t:=t+x;

end;

write(t);

readln;

end.

2: 

uses crt;

var dem,x,i,n:integer;

begin

clrscr;

dem:=0;

n:=10;

for i:=1 to n do

begin

readln(x);

if x mod 2=0 then inc(dem);

end;

write(dem);

readln;

end.

Bình luận (1)
Lê Chiêu Nguyên	Vũ
4 tháng 4 2023 lúc 10:18

3

program Cacsole;
uses crt;
var M, N, i: integer;
begin
clrscr;
write ('Nhap M= '); readln(M);
write ('Nhap N= '); readln(N);
for i := M to N do

if  i mod 2 = 1 then
write (i,' ');
readln;
end.

Bình luận (1)